import request from './request'

export const authApi = {
  // 用户登录
  login(data) {
    return request.post('/auth/login', data)
  },

  // 用户注册
  register(data) {
    return request.post('/auth/register', data)
  },

  // 获取当前用户信息
  getCurrentUser(username) {
    return request.get('/auth/me', { params: { username } })
  },

  // 用户登出
  logout(username) {
    return request.post('/auth/logout', null, { params: { username } })
  }
} 